if exists (select 1 from sysobjects where name = 'del_Person' and type = 'P')
begin
   drop procedure del_Person
   print 'Procedure: del_Person deleted ...'
end
go
create procedure del_Person(
  @prsid          int   = 1
)
as
begin
  set nocount on
  delete from PersonalAbteilung where PersonalAbteilung.PrsId = @prsid
  delete from Arbeitspensum where Arbeitspensum.PrsID = @prsid
  delete from PersonAnstellung where PersonAnstellung.PrsID = @prsid
  delete from Arbeitszeit where Arbeitszeit.PrsID = @prsid
  delete from PersonZeiten where PersonZeiten.PrsID = @prsid
  delete from Ferien where Ferien.PrsId = @prsid
  delete from Dienstplan where Dienstplan.PrsID = @prsid
  delete from Colorplan where Colorplan.PrsID = @prsid
  delete from Saldoanpassung where PrsID = @prsid
  
  delete from Person where Person.PrsId = @prsid
  
end
go
print 'Procedure: del_Person done ...'
go
grant exec on del_Person to prsadmins with grant option
go
grant exec on del_Person to prsusers
go

